/**
 * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
 */
// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作
const install = (Vue, vm) => {

	// 参数配置对象
	const config = vm.vuex_config;

	console.log(config, 999999999999);

	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		
		
		// 会员页接口
		vip: {
			// 获取会员配置列表
			vip_config: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/config/vip_config', params),
			// 获取会员置顶会员信息
			getTopInfo: (params = {}) => vm.$u.post('/vip/getTopInfo', params),
			// 获取小程序的体验卡列表
			getSampleList: (params = {}) => vm.$u.post('/api/config/sample_list', params),
			// 获取会员购买列表
			getBuyList: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/config/buy_list', params),
		},
		
		
		// 首页
		home: {
			// 今日必玩
			hot_assess: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/index/hot_assess', params),
			// 更多好玩
			more_assess: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/index/more_assess', params),
			// 搜索好玩
			search_assess: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/index/search_assess', params),
			// 校验口令跳转页面
			check_code: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/index/check_code', params),
			
		},
		// 登录
		login: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/auth/login', params),
		// 退出登录
		logout: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/auth/logout', params),
		
		// 发现
		find: {
			series_list: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/discover/series_list', params),
		},
		// 小程序分类页接口
		category: {
			// 分类列表
			getList: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/gallery/category/list', params),
			// 图集列表
			getAtlasList: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/gallery/category/atlas',
				params),
			// 关键词列表
			// getKeywordList: (params = {}) => vm.$u.post('/category/getKeywordList', params),
		},
		// 小程序图集页接口
		atlas: {
			// 获取相同图集列表
			getList: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/gallery/atlas/list', params),
			// 资源列表
			getResourcesList: (params = {}) => vm.$u.post(config.baseUrlcs6 +
				'/api/gallery/atlas/resources_list', params),
		},

		// 我的页面
		mine: {
			make_index: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/mine/record/make_index', params),
			make_sort: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/mine/record/make_sort', params),
			make_list: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/mine/record/make_list', params),
			// 订单列表
			order_list: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/mine/order/list', params),
			// 订单详情
			order_info: (params = {}) => vm.$u.post(config.baseUrlcs6 + '/api/mine/order/info', params),
			// 获取下载的分类列表
			getDownloadCategory: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/mine/download/category_ids', params),
			// 获取下载的图片
			getDownloadPicList: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/mine/download/pic_list', params),
			// 浏览记录
			atlas_list: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/mine/download/atlas_list', params),
			// 提交意见反馈
			addRoast: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/roast/add', params),
			// 获取在线客服地址
			getCustomerUrl: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/customer/url', params),



			// 获取用户会员信息
			getVipInfo: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/mine/user/status', params),
			// 获取订单列表
			getOrderList: (params = {}) => vm.$u.post('/mine/orderList', params),
		
			// 获取图片相同图集的资源列表
			getDownloadResourcesList: (params = {}) => vm.$u.post('/mine/getDownloadResourcesList', params),
			// 获取下载过的图集列表
			getDownloadAtlasList: (params = {}) => vm.$u.post('/mine/getDownloadAtlasList', params),
			
			// 移除资源
			resourceRemoveOne: (params = {}) => vm.$u.post('/upload/removeOne', params),
			

		},



		wechartsCircle: (params = {}) => vm.$u.postJson(config.adminPath + '/app/wxg/getGroupList', params),

		// 基础服务：登录登出、身份信息、菜单授权、切换系统、字典数据等
		lang: (params = {}) => vm.$u.get('/lang/' + params.lang),
		index: (params = {}) => vm.$u.get(config.adminPath + '/mobile/index', params),
		getUserInfo: (params = {}) => vm.$u.get(config.adminPath + '/mobile/user/getUserInfo', params),
		// login: (params = {}) => vm.$u.post(config.adminPath + '/mobile/login/loginByPassword', params),
		sendCode: (params = {}) => vm.$u.post(config.adminPath + '/mobile/login/sendCode', params),
		registerUser: (params = {}) => vm.$u.post(config.adminPath + '/mobile/user/registerUser', params),
		//首页相关api
		getIndexCardInfo: (params = {}) => vm.$u.get(config.adminPath + '/mobile/index/getIndexCardInfo',
			params),
		getM2mOrderFlowList: (params = {}) => vm.$u.get(config.adminPath + '/mobile/index/getM2mOrderFlowList',
			params),
		//获取卡可购买套餐包
		getM2mOrderPackageList: (params = {}) => vm.$u.get(config.adminPath +
			'/mobile/index/getM2mOrderPackageList', params),

		// logout: (params = {}) => vm.$u.get(config.adminPath + '/mobile/login/logout', params),
		authInfo: (params = {}) => vm.$u.get(config.adminPath + '/authInfo', params),
		menuTree: (params = {}) => vm.$u.get(config.adminPath + '/menuTree', params),
		switchSys: (params = {}) => vm.$u.get(config.adminPath + '/switch/' + params.sysCode),
		dictData: (params = {}) => vm.$u.get(config.adminPath + '/system/dict/data/type/' + params.dictType),

		// 账号服务：验证码接口、忘记密码接口、注册账号接口等
		validCode: (params = {}) => vm.$u.getText('/validCode', params),
		getFpValidCode: (params = {}) => vm.$u.post('/account/getFpValidCode', params),
		savePwdByValidCode: (params = {}) => vm.$u.post('/account/savePwdByValidCode', params),
		getRegValidCode: (params = {}) => vm.$u.post('/account/getRegValidCode', params),
		saveRegByValidCode: (params = {}) => vm.$u.post('/account/saveRegByValidCode', params),

		// logo 是否主小程序 小程序默认头像
		logo: {
			getLogo: (params = {}) => vm.$u.post('/dy/getAppletInfo', params),
		},
		// 抖音相关
		dy: {
			// 获取抖音token
			getToken: (params = {}) => vm.$u.post('/dy/getToken', params),
			// 校验抖音token
			checkToken: (params = {}) => vm.$u.post('/dy/checkToken', params),
			// 获取抖音分享信息
			getShareInfo: (params = {}) => vm.$u.post('/dy/getShareInfo', params),
			// 获取抖音广告信息
			getAdInfo: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/config/ad_info', params),
			// 抖音创建订单
			createOrder: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/mine/order/add', params),
			// 支付成功后校验订单状态
			checkOrderStatus: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/mine/order/status', params),
			// 获取子(跳转)小程序的appid
			getJumpAppid: (params = {}) => vm.$u.post('/dy/getJumpAppid', params),
		},

		// 口令
		code: {
			// 获取关键词搜索列表
			check: (params = {}) => vm.$u.post('/code/checkCode', params),
		},

		// 搜索页
		search: {
			// 获取关键词搜索列表
			getList: (params = {}) => vm.$u.post('/search/getList', params),
			// 获取搜索页推荐列表
			getRecommendList: (params = {}) => vm.$u.post('/search/getRecommendList', params),
		},
		// 小程序首页接口
		index: {
			// 获取首页信息  轮播图  分类列表
			getInfo: (params = {}) => vm.$u.post('/index/getInfo', params),
			// 获取首页推荐图集
			getRecommendPicList: (params = {}) => vm.$u.post('/index/getRecommendPicList', params),
			// 获取分类下 展示在首页的 图集的图片
			getCategoryPicList: (params = {}) => vm.$u.post('/index/getCategoryPicList', params),
		},

		// 小程序测评页接口
		assess: {
			// 测评列表
			getList: (params = {}) => vm.$u.post('/assess/getAssessList', params),
			// 测评详情
			// getInfo: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/index/assess_info', params),
			getInfo: (params = {}) => vm.$u.post('https://qutuapi.wuyouzhuan888.com/api/applet/assess/getAssessInfo', params),
			
			
			// 测评问题
			getQuestion: (params = {}) => vm.$u.post('/assess/getQuestionList', params),
			// 测评结果
			getResult: (params = {}) => vm.$u.post('/assess/getResult', params),
		},

		// 下载页接口
		download: {
			// 获取用户下载信息
			getInfo: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/mine/download/info', params),
			// 下载统计
			statistics: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/download/statistics', params),
		},

		


		// APP公共服务
		upgradeCheck: () => vm.$u.post('/app/upgrade/check', {
			appCode: config.appCode,
			appVersion: config.appVersion
		}),
		commentSave: (params = {}) => vm.$u.post('/app/comment/save', params),

		// // 个人信息修改
		// user: {
		// 	saveUserInfo: (params = {}) => vm.$u.post(config.adminPath + '/mobile/user/saveUserInfo', params),
		// 	infoSavePwd: (params = {}) => vm.$u.put(config.adminPath + '/system/user/profile/updatePwd',
		// 		params),
		// 	infoSavePqa: (params = {}) => vm.$u.post(config.adminPath + '/sys/user/infoSavePqa', params),
		// },

		// 视频页
		video: {
			// 获取视频分类
			getVideos: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/discover/video/sort_list', params),
			// 获取视频列表
			getVideoList: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/discover/video/list', params),
			// 搜索视频列表
			getSearchList: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/discover/video/search_list', params),
			// 视频预览
			getVideoInfo: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/discover/video/info', params),
			// 视频制作信息
			getMakeInfo: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/discover/video/make_info', params),
			// 视频制作
			makeVideo: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/discover/video/create_video', params),
			// 价格
			getPriceList: (params = {}) => vm.$u.post(config.baseUrlcs6 +'/api/config/price_configs', params),
			// 创建订单
			addOrder: (params = {}) => vm.$u.post('dy/addOrder', params),
			// 检查订单
			getOrderStatus: (params = {}) => vm.$u.post('dy/getOrderStatus', params),
			// 制作列表
			makeInfo: (params = {}) => vm.$u.post('mine/makeInfo', params),
			// 视频制作状态
			getMakeStatus: (params = {}) => vm.$u.post('videos/getMakeStatus', params),
			// 视频制作列表
			makeList: (params = {}) => vm.$u.post('mine/makeList', params),
			// 购买记录列表
			getOrdersList: (params = {}) => vm.$u.post('mine/getOrdersList', params),
			// 消耗记录列表
			getConsumeRecords: (params = {}) => vm.$u.post('mine/getConsumeRecords', params),
			// 制作币
			getCoins: (params = {}) => vm.$u.post('mine/getCoins', params),
			// 删除制作记录
			makeInfoDel: (params = {}) => vm.$u.post('mine/makeInfoDel', params),
			// 敏感词
			sensitive: (params = {}) => vm.$u.post('videos/sensitive', params),

		},

	};

}

export default {
	install
}
